package io.kiki.sba.registry.common.model.slot.func;


import io.kiki.sba.registry.common.model.slot.SlotConfig;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public final class SlotFunctionRegistry {
    private static final Map<String, SlotFunction> MAP = new ConcurrentHashMap<>();

    static {
        register(Crc32cSlotFunction.INSTANCE);
        register(MD5SlotFunction.INSTANCE);
    }

    public static void register(SlotFunction slotFunction) {
        MAP.put(slotFunction.name(), slotFunction);
    }

    public static SlotFunction getSlotFunction() {
        return MAP.get(SlotConfig.Slot_Function);
    }
}
